import http from "@/utils/request";

//---------------拜访报告---------------------------拜访报告-------------------------------------拜访报告--------------------------------拜访报告----------------------------------------------
// 获取用户信息
export function GetInfoByCode(params) {
  return http({
    url: "/api/visit/GetDingTalk",
    method: "get",
    params: params,
  });
}

// 获取组织架构树
export function getDeptTree() {
  return http({
    url: "/api/visit/GetDepart",
    method: "get",
  });
}

// 查询用户
export function getUserList(params) {
  return http({
    url: "/api/visit/GetUserList",
    method: "get",
    params,
  });
}

// 新增
export function addVisitRecords(data) {
  return http({
    url: "/api/visit/AddVisitRecords",
    method: "post",
    data,
  });
}

// 编辑
export function updateVisitRecords(data) {
  return http({
    url: "/api/visit/UpdateVisitRecords",
    method: "post",
    data,
  });
}

// 分页列表
export function getVisitList(params) {
  return http({
    url: "/api/visit/VisitRecordsList",
    method: "get",
    params,
  });
}

// 详情
export function getVisitInfoById(params) {
  return http({
    url: "/api/visit/GetVisitRecords",
    method: "get",
    params,
  });
}

// 进入详情修改已读状态
export function updateRead(params) {
  return http({
    url: "/api/visit/UpdateRead",
    method: "get",
    params,
  });
}

// 已读 未读列表
export function getReadList(params) {
  return http({
    url: "/api/visit/ReadList",
    method: "get",
    params,
  });
}

// 新增评论
export function addVisitComment(data) {
  return http({
    url: "/api/visit/AddVisitComment",
    method: "post",
    data,
  });
}

// 评论列表
export function visitCommentList(params) {
  return http({
    url: "/api/visit/VisitCommentList",
    method: "get",
    params,
  });
}

// 详情分享
export function visitShare(data) {
  return http({
    url: "/api/visit/VisitShare",
    method: "post",
    data,
  });
}

// 根据客户id查询项目列表
export function projectList(params) {
  return http({
    url: "/api/visit/ProjectList",
    method: "get",
    params,
  });
}

// 根据多个联系人id查询项目列表
export function getProjectByContactIds(params) {
  return http({
    url: "/api/visit/ProjectList",
    method: "get",
    params,
  });
}

// 出差计划列表查询在拜访报告里
export function tripPlanList_Vistt(params) {
  return http({
    url: "/api/visit/TripPlanList",
    method: "get",
    params,
  });
}

// 查询客户
export function getCustomList(params) {
  return http({
    url: "/api/visit/GetCustomList",
    method: "get",
    params,
  });
}

// 查询联系人
export function getContactsList(params) {
  return http({
    url: "/api/visit/GetContactsList",
    method: "get",
    params,
  });
}

//-----------------------出差计划-----------------出差计划---------------------出差计划------------------出差计划-------------------------出差计划-----------------出差计划---------------------出差计划---------------

// 新增出差计划
export function addTripPlan(data) {
  return http({
    url: "/api/tripplan/AddTripPlan",
    method: "post",
    data,
  });
}

// 出差计划详情
export function getTripPlanById(params) {
  return http({
    url: "/api/tripplan/GetTripPlan",
    method: "get",
    params,
  });
}

// 出差计划列表
export function tripPlanList(params) {
  return http({
    url: "/api/tripplan/TripPlanList",
    method: "get",
    params,
  });
}

// 出差计划编辑
export function updateTripPlan(data) {
  return http({
    url: "/api/tripplan/UpdateTripPlan",
    method: "put",
    data,
  });
}

// 客户下拉框 联系人
export function getCustomListUser(params) {
  return http({
    url: "/api/tripplan/GetCustomList",
    method: "get",
    params,
  });
}
